move users to new db  based on location
Hi all I have an exchange server 2007 environment with roughly 1,000 users. We have recently added a business unit in Santa Clara with about 200 people. I created the new users in AD and gave them all mailboxes but we have decided to put a DC and Exchange server in SC. Now I want to move mailboxes from our existing server to the new server based on the AD attribute of "physicalDeliveryOfficeLocation". This shows up as the Office in the Organization tab in Exchange properties. So far the only way I have seen to do this is to extract a list of Exchange aliases and filter them based on their office location, then use that list in csv form to do the bulk move. I was wondering if there was a simpler, one-step way to do this. The logic would look like this. 1. loop through all exchange users 2. Get the user information of alias and office 3. If "office=Santa Clara", move the mailbox. Suggestions? Thanks Richard
April 1st, 2010 7:55pm

PS. I know how to do this through the console using a filter and multi-selecting. But I would prefer to do this as a script using Powershell as a learning activity. My scripting skills need work.
Free Windows Admin Tool Kit Click here and download it now
April 1st, 2010 8:05pm

Well, it is possible but i´m not sure about what you think when talkin about simple... you can do somehing like get-mailbox -filter "Office -like 'santa clara'" | move-mailbox - targetdatabase db Hope this helpCapecolMCSA - MCTS Exchange Server 2007 - 2010 - MCITP Messaging 2010Blog: http://capecol.spaces.live.com/default.aspx
April 5th, 2010 1:49am

Good command. If you're not sure about moving the correct mailboxes, you can first run Get-Mailbox -Server <originalExchangeServer> -ResultSize unlimited | Where {$_.Office -Like 'santa clara'}This will get you a list of mailboxes that you potentially will move. If the list is OK, then move mailboxes with.Get-Mailbox -Server <originalExchangeServer> -ResultSize unlimited | Where {$_.Office -Like 'santa clara'} | Move-Mailbox -TargetDatabase <databaseName on destination server> depending on naming convention you might have to enter the targetdatabase like 'Servername\databasename' lasse at humandata dot se, http://anewmessagehasarrived.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
April 5th, 2010 10:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics